package com.openitems.data.pojo;

// Generated Aug 11, 2014 11:52:00 PM by Hibernate Tools 4.0.0

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Artifact generated by hbm2java
 */
@Entity
@Table(name = "artifact", catalog = "openitems")
public class Artifact implements java.io.Serializable {

	private Integer id;
	private Project project;
	private String name;
	private String description;
	private String ver;
	private Integer owner;
	private Date startDate;
	private Integer assignedTo;
	private String type;
	private Set<Item> items = new HashSet<Item>(0);

	public Artifact() {
	}

	public Artifact(Project project, String name) {
		this.project = project;
		this.name = name;
	}

	public Artifact(Project project, String name, String description,
			String ver, Integer owner, Date startDate, Integer assignedTo,
			String type, Set<Item> items) {
		this.project = project;
		this.name = name;
		this.description = description;
		this.ver = ver;
		this.owner = owner;
		this.startDate = startDate;
		this.assignedTo = assignedTo;
		this.type = type;
		this.items = items;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "project_id", nullable = false)
	public Project getProject() {
		return this.project;
	}

	public void setProject(Project project) {
		this.project = project;
	}

	@Column(name = "name", nullable = false, length = 45)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "description", length = 45)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Column(name = "ver", length = 45)
	public String getVer() {
		return this.ver;
	}

	public void setVer(String ver) {
		this.ver = ver;
	}

	@Column(name = "owner")
	public Integer getOwner() {
		return this.owner;
	}

	public void setOwner(Integer owner) {
		this.owner = owner;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "start_date", length = 19)
	public Date getStartDate() {
		return this.startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	@Column(name = "assigned_to")
	public Integer getAssignedTo() {
		return this.assignedTo;
	}

	public void setAssignedTo(Integer assignedTo) {
		this.assignedTo = assignedTo;
	}

	@Column(name = "type", length = 45)
	public String getType() {
		return this.type;
	}

	public void setType(String type) {
		this.type = type;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "artifact")
	public Set<Item> getItems() {
		return this.items;
	}

	public void setItems(Set<Item> items) {
		this.items = items;
	}

}
